Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added device content dict to tango.sim. #712

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

burkeds
Copy link
Collaborator

@burkeds burkeds commented Dec 19, 2024

This dict can be imported and passed to MultiDeviceTestContext to access the demo device servers in a normal python script or ipython kernel. This step is analogous to start_ioc_subprocess used in the epics demo.

from tango.test_context import MultiDeviceTestContext
from ophyd_async.tango.sim import device_content, TangoDetector

async def test_devices():
    with MultiDeviceTestContext(device_content, process=True) as context:
        detector = TangoDetector(
            mover_trl=context.get_device_access("sim/motor/1"),
            counter_trls=[
                context.get_device_access("sim/counter/1"),
                context.get_device_access("sim/counter/2"),
            ],
            name = "detector"
        )
        await detector.connect()
        await detector.read()

await test_devices()

… passed to MultiDeviceTestContext to access the demo device servers in a normal python script or ipython kernel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant